package io.renren.modules.teacher.service.impl;

import io.renren.common.utils.PageUtils;
import io.renren.modules.teacher.dao.CourseStudentManageDao;
import io.renren.modules.teacher.service.CourseStudentManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CourseStudentManageServiceImpl implements CourseStudentManageService {
    @Autowired
    private CourseStudentManageDao courseStudentManageDao;
    @Override
    public PageUtils list(Map<String, Object> param) {
        List<Map<String, Object>> list = courseStudentManageDao.queryList(param);
        int total = courseStudentManageDao.querytotal(param);
        int limit = Integer.parseInt(param.get("limit").toString());
        int page = Integer.parseInt(param.get("page").toString());
        PageUtils pageUtils = new PageUtils(list,total,limit,page);
        return pageUtils;
    }

    @Override
    public void delete(String[] listIds, String courseInfoid) {
        courseStudentManageDao.delete(listIds,courseInfoid);
    }
}
